import axios from '../../axios'
const customer = {
     //添加客户
    addCustomer: (addInfo) => {
       return axios({
            url: '/customer',
            method: 'post',
            data: addInfo
        });
    },
    //渲染客户
    renderCustomer: (pageData)=>{
        return axios({
            url: '/customer',
            method: 'get',
            params:pageData
        });
    },
    //删除客户
    delCustomer:(_id)=>{
          return axios({
              url: '/customer',
              method:'delete',
              data:{_id}
          })
    },
    //得到用户信息
     getOne:(_id)=>{
        return axios({
            url: `/customer/${_id}`,
            method:'get',
        })
     },
    // 确认修改
     update:(updateInfo)=>{ 
            return axios({
                url: `/customer`,
                method:'put',
                data: updateInfo
            })
     }
}
export default customer;